<template>
	<el-dialog :visible.sync="setCheckManshow" @close="$emit('update:showsetCheckMan',false)" width="35%" :show-close='false'
	 :close-on-click-modal="false" :append-to-body='true'>

		<span slot="title" class="dialog-title">
		  	设置检测人员
			<el-button  size="mini" class="popupClose" @click="resetsetCheckManForm">关闭</el-button>
		</span>
		<el-form label-width="110px" :inline="false" class="demo-form-inline">

			<el-form-item label="检测人">
				<el-col :span="22">
					<el-select v-model="checkMan" placeholder="请选择">
						<el-option v-for="item in EmployeeByLabs" :key="item.account" :label="item.name" :value="item.account+','+item.name" :disabled="item.disabled">
						</el-option>
					</el-select>
				</el-col>
			</el-form-item>
		</el-form>

		<span slot="footer" class="dialog-footer">
			    <el-button type="primary" @click="doEdit" size="mini">确 定</el-button>
			    <el-button  size="mini" @click="resetsetCheckManForm">取 消</el-button>
			  </span>
	</el-dialog>
</template>

<script>
	import { mapState } from 'vuex'

	export default {
		props: ['showsetCheckMan', 'selectedArr'],
		data() {
			return {
				checkMan: '',
				checkManName: '',
				popupPenalStyle: {
					'min-height': '500px',
				},
				penalContentStyle: {
					'height': (window.innerHeight - 400) + 'px'
				}
			}
		},
		computed: {
			...mapState(['enableStatus', 'tableHeightA', 'yesorno', 'enableStatus', 'bottleType', 'EmployeeByLabs', 'xianchangrenData']),
			setCheckManshow: {
				get: function () {
					return this.showsetCheckMan
				},
				set: function (newValue) {

				}
			}

		},
		mounted() {

		},
		methods: {
			resetsetCheckManForm() {
				this.checkMan = '';
				this.$emit('update:showsetCheckMan', false)
			},
			doEdit() {
				for (let j of this.$parent.getPlanData.sampleBeans) {
					for (let k of j.detectBeans) {
						for (let i of this.selectedArr) {
							if (k.detectability == i.detectability) {
								this.$set(k, 'analyst', this.checkMan.split(',')[0])
								this.$set(k, 'analystName', this.checkMan.split(',')[1])
							}
						}
					}
				}
				
				this.resetsetCheckManForm();
				this.$parent.reload()
			}
		}
	}

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>